package leetcode_701_800;

public class LeeCode_790 {
    public static void main(String[] args) {
        System.out.println(numTilings(100));
    }
    private static int numTilings(int n) {
        long mod = (long) (1e9 + 7);
        long[] dp = new long[10001];
        dp[1] = 1;
        dp[2] = 2;
        dp[3] = 5;
        if (n <= 3)
            return (int) dp[n];
        for (int i = 4; i <= n; i++) {
            dp[i] = (dp[i - 1] * 2 + dp[i - 3]) % mod;
        }
        return (int) dp[n];
    }
}